
let confirmInstance: any =  {
    confirmWarning:() => {}
};

// 注册确认框
export function installConfirm() {
    return function registerConfirm(instance:any) {
        if (instance) {
            confirmInstance = instance;
        }
    }
}

// 使用确认框
export function useConfirm(){
    const isInstance = () => {
        if (!confirmInstance) {
            throw 'confirmInstance is undefined'
            return { };
        }
    }
    isInstance();
    return confirmInstance;
}
